#!/bin/sh
status=$1
if [ "$status" = "ok" ]
then
echo "led has been tested, it is ok"
sleep 1
echo 131 > /sys/class/gpio/export    #导出GPIO
echo out > /sys/class/gpio/gpio131/direction  #设置GPIO输出方向
for i in {1..3}; do
    echo 1 > /sys/class/gpio/gpio131/value
    sleep 1
    echo 0 > /sys/class/gpio/gpio131/value
    sleep 1
done
echo 0 > /sys/class/gpio/gpio131/value
echo 131 > /sys/class/gpio/unexport       #取消导出GPIO
fi

if [ "$status" = "err" ]
then
echo "led has been tested, it is fail"
fi